package edu.whu.demo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import edu.whu.demo.domain.ScheduleDetail;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ScheduleDetailDao extends BaseMapper<ScheduleDetail> {

    @Select("select * from schedule_detail sd" +
            " where sd.schedule_id = #{scheduleId}")
    public List<ScheduleDetail> findScheduleDetailsBySchedule(Long scheduleId);

    @Delete(
            "delete from schedule_detail " +
                    " where schedule_id = #{scheduleId}"
    )
    public void deleteScheduleDetailBySchedule(Long scheduleId);

}
